home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / CARDS.ZIP / README.TXT < prev   
Encoding:
Text File  |  1996-02-06  |  3.0 KB  |  108 lines

  1. TCards
  2.  
  3. This VCL allows the user to easily use the cards supplied with 
  4. Windows in the CARDS.DLL, and build games.
  5.  
  6. PROPERTIES
  7.  
  8. CardBack:     This is the style of the design used to draw the
  9.               card when CardStyle is set to cdBack.  Possible
  10.               values = (cbDiag,cbHatch,cbRobot,cbRoses,             
  11.                         cbGreenPlant,cbBluePlant,                   
  12.                         cbLightFish,cbDarkFish,cbShell,cbCastle,    
  13.                         cbBeach,cbHand).                        
  14.  
  15. CardStyle:    This depicts how the card will be drawn.  Possible
  16.               values are:
  17.               cdBack:   Draw card back design
  18.               cdFront:  Draw card front
  19.               cdO:      Draw placeholder card
  20.               cdX:      Draw invalid placeholder card
  21.  
  22. FaceValue:    This is the face value of the card (ie 1-13)
  23.  
  24. Selected:     When selected is true, card is drawn inversed, else
  25.               card is drawn normal.
  26.  
  27. Suit:         Depicts what suit the given card is.  Possible
  28.               values are:
  29.               suClubs
  30.               suDiamonds
  31.               suHearts
  32.               suSpades
  33.  
  34. Value:        Depicts the value of the card using the formula:
  35.               Value:=FaceValue + (ord(Suit) * 13);
  36.               Conversely:
  37.               FaceValue:=Value - (ord(Suit) * 13);
  38.  
  39.  
  40.  
  41. Installing TCards
  42.  
  43. To install this VCL, copy both CARDS.DCU and CARDS.DCR to the
  44. directory where you have your other shareware controls.  Then, 
  45. from Delphi's main menu, select Options|Install Components.  In the
  46. dialog, click on the Add... button, then Browse... and change to the 
  47. drive/directory where you stored the above two files.  Select 
  48. CARDS.DCU and click OK, then OK again.
  49.  
  50. Using TCARDS
  51.  
  52. To use this control, simply place it on your form, and edit the 
  53. CardBack, CardStyle, Suit, and Value properties.
  54.  
  55. Sample Procedures:
  56.  
  57. procedure initdeck;
  58. var
  59.     i:integer;
  60. begin
  61.     {Initializes deck array, do once per program, or to reset}
  62.     {deck[1..52] is a global array}
  63.     for i:= 1 to 52 do
  64.         deck[i]:=i;
  65. end;
  66.  
  67.  
  68. procedure shuffledeck;
  69. var
  70.     i,j,k,temp:integer;
  71. begin
  72.     {deck[1..52] is a global array}
  73.     Randomize;
  74.     For i := 1 To 10 do
  75.         For j := 1 To 52 do
  76.         begin
  77.             k := trunc(1 + (52 * Random));
  78.             temp := deck[j];
  79.             deck[j] := deck[k];
  80.             deck[k] := temp;
  81.         end;
  82. end;
  83.  
  84. Support:
  85.  
  86. Send comments and questions to:
  87.  
  88. Zane Rathwick
  89. Indigo Software
  90.  
  91. CIS: 74633,1314
  92. AOL: ZaneR
  93. Internet:   ZaneR@aol.com
  94. U.S. Mail:  Zane Rathwick
  95.             Indigo Software
  96.             4240 Park Newport Suite 308
  97.             Newport Beach, CA 92660
  98.  
  99. Registering TCards
  100.  
  101. To register TCards and receive source code, send $10 (+$2 S&H) to:
  102.  
  103. Indigo Software
  104. 4240 Park Newport # 308
  105. Newport Beach, CA 92660
  106.  
  107. You can save the $2 shipping fee by specifying a Compuserve or AOL 
  108. account to have your control sent to instead of by mail.